package com.zh.mp.demo.modules.order;

import com.zh.mp.demo.modules.order.entity.OrderDto;
import com.zh.mp.demo.modules.order.entity.Orders;
import com.zh.mp.demo.modules.order.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderController {
    @Autowired
    private IOrderService orderService;


    @RequestMapping("/creatOrder")
    public String creatOrder () {
        OrderDto orderDto = OrderDto.builder()
                .goodsCode("G-01")
                .memberCode("M-001")
                .orderNumber(1).build();
        Orders order = orderService.creatOrder(orderDto);
        return "创建订单完成"+order.getOrderCode();
    }
}
